Asm.Bat  and  Assemble.Bat

Each of these batch files executes the sequence of commands that attempts to build an iHex image from AVR Assembly Language source code.  Both Asm.Bat and Assemble.Bat are provided as a functional starting point for a "MakeFile" - a single command which creates all of the target files.  Each batch file exits without completing all portions if it detects an error was encountered.  When successfully completing each portion, each batch file creates seven (7) files that have the same base name during that process, but different extensions.  The files created during the assembly by Asm.Bat and Assemble.Bat are:

  Extension        Created by        Created from  Contents and purpose
.ELFAVR-AS.Exe.ASM & .PTRExecutable and Linkable format, a standard binary file format
.HEXAVR-ObjCopy.Exe.ELFIntel HEX format, a standard ASCII format, used to implement changes in MIRTOS devices
.TRMTrimIHex.Exe.HEXAn iHex file with leading lines of zeros removed
.LSTAVR-ObjDump.Exe.ELFProgram listing, with known variable and constant names applied
.SYMAVR-ReadELF.Exe.ELFAll variables and contants generated by the .ASM source and all .INCLUDE files
.PBKThe batch file.PTRBackup copy of prior .PTR file, saved before running the MakePtr.Exe command
.PTRMakePtr.Exe.SYMVariables and contant names that can be pulled in during the next assembly pass

These batch files use an Assembly source code file with the .ASM extension.  Some other extension may certainly be used, in which case Asm.Bat and/or Assembly.Bat will need to be edited, changing "%1.Asm" to the desired extension, "%1.A" or "%1.S", for example.  Each also assumes that a .PTR file already exists, and checks to verify that.  If not, it tries to copy the BinDefs.Def from the .INCLUDE directory to create the .PTR file.  An initial, trivial .PTR file can be created with just a single space in it, for examples, to satisfy the batch file checking.

Asm.Bat is the smaller, simpler, most commonly used version.  It is invoked using the simple command line syntax "Asm SourceFile" for the 328P microcontroller (MCU), "Asm SourceFile 1" for the 1284P, or "Asm SourceFile 2" for the 2560.  The first parameter is the base filename, without the extension, and is required.  The second parameter simply specifies an alternate MCU.

Assemble.Bat was created and used to build each MIRTOS operating system .HEX file that is unique to each supported type of MIRTOS device.  It is a much larger series of batch commands which can build either an 8 MHz or 16 MHz image for over ten (10) different MIRTOS-based devices.  It isn't expected that it be used directly, but that it be utilized as an example and resource instead.  It isn't particularly polished but is certainly functional.  We considered not including it in the files available to be downloaded, but decided its educational value merited its inclusion.

Downloads page